package com.jxdinfo.hussar.cloud.module.example.dljc.basketdatahistory.controller;

import com.jxdinfo.hussar.cloud.module.example.dljc.basketdatahistory.vo.BasketDataHistoryPageVO;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdatahistory.vo.BasketDataHistorySearchVO;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdatahistory.vo.BasketDataHistoryVO;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketpoint.vo.BasketPointPageVO;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketpoint.vo.BasketPointSearchVO;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketpoint.vo.BasketPointVO;
import com.jxdinfo.hussar.platform.core.base.apiresult.ApiResponse;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventGrade;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventType;
import com.jxdinfo.hussar.support.mp.base.controller.HussarBaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jxdinfo.hussar.support.audit.core.annotations.AuditLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdatahistory.model.BasketDataHistory;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdatahistory.service.BasketDataHistoryService;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdatahistory.model.BasketDataHistory;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdatahistory.service.BasketDataHistoryService;

import java.util.List;

/**
 * 吊篮历史数据控制器
 */
@RestController(value = "dljc.basketdatahistory.BasketDataHistoryController")
@AuditLog(moduleName = "吊篮历史数据")
@RequestMapping(value = "/dljc/basketDataHistory")
public class BasketDataHistoryController extends HussarBaseController<BasketDataHistory, BasketDataHistoryService> {

    private static final Logger logger = LoggerFactory.getLogger(BasketDataHistoryController.class);

    @Autowired
    private BasketDataHistoryService basketDataHistoryService;

    /**
     * 分页查询吊篮历史数据
     *
     * @param basketDataHistorySearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "吊篮历史数据", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.INSERT)
    @PostMapping("findByPage")
    public ApiResponse<BasketDataHistoryPageVO> findByPage(@RequestBody BasketDataHistorySearchVO basketDataHistorySearchVO) {
        //todo 没有获取项目编号工具类

        return basketDataHistoryService.findByPage(basketDataHistorySearchVO);
    }

    /**
     * 吊篮历史数据曲线图查询
     *
     * @param basketDataHistorySearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "吊篮历史数据", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.INSERT)
    @PostMapping("findLineChart")
    public ApiResponse<List<BasketDataHistoryVO>> findLineChart(@RequestBody BasketDataHistorySearchVO basketDataHistorySearchVO) {
        //todo 没有获取项目编号工具类

        return basketDataHistoryService.findLineChart(basketDataHistorySearchVO);
    }
}
